module Installr::Client::Command

  class System < Base
    def version
      puts "[system:version] Installr version #{Installr::VERSION}"
    end

    def export
      puts "[system:export] export database from local" if @options[:verbose]
      @log.info("[system:export] export database from local")

      if @options[:export_path]
        @storage.export(@options[:export_path], @options[:initialize])
      else
        puts "[system:export] missing the --export_path option"
	@log.error("[system:export] missing the --export_path option")
	return -1
      end
    end

    def import
      puts "[system:import] import database from local" if @options[:verbose]
      @log.info("[system:import] import database from local")

      if @options[:import_path]
        @storage.import(@options[:import_path], @options[:initialize])
      else
        puts "[system:import] missing the --import_path option"
	@log.error("[system:import] missing the --import_path option")
	return -1
      end
    end
  end

end
